/**
 * Copyright (c) 2012 Nokia Corporation.
 * All rights reserved.
 *
 * For the applicable distribution terms see the license text file included in
 * the distribution.
 */

import QtQuick 1.1
import com.nokia.meego 1.0

Page {
    Row {
        id: logoutSettingRow

        anchors {
            top: parent.top
            left: parent.left
            right: parent.right
            topMargin: 20
            leftMargin: 10
            rightMargin: 10
        }

        spacing: 10

        Label {
            width: logoutSettingRow.width
                   - logoutSettingSwitch.width
                   - logoutSettingRow.spacing;
            height: logoutSettingSwitch.height
            //font.pixelSize: 30
            verticalAlignment: Text.AlignVCenter
            text: "Logout from Facebook on exit"
        }
        Switch {
            id: logoutSettingSwitch
            checked: main.logoutOnExit

            onCheckedChanged: {
                console.debug("Setting \"logoutOnExit\" setting to " + checked);

                if (checked) {
                    settings.setSetting("logoutOnExit", true);
                    main.logoutOnExit = true;
                }
                else {
                    settings.setSetting("logoutOnExit", false);
                    main.logoutOnExit = false;
                }
            }
        }
    }

    tools: ToolBarLayout {
        ToolIcon {
            iconId: "toolbar-back"
            onClicked: pageStack.pop();
        }
    }
}
